/** This is a little bit optimised implementation that creates a square and saves it as a .BMP file.
 */
#include "image.h"


int main(void)
{
Image Img;
unsigned x, y;
RGBQuad Color1, Color2;

  Color1.R = Color1.G = Color1.B = 0;
  Color2.R = Color2.G = Color2.B = 255;

  Img.AttachRaster(CreateRaster2DRGB(255,255,8));
  if(Img.Raster==NULL) return -1;

  for(y=0; y<Img.Raster->Size2D; y++)
  {
    Raster1DAbstract * const r1D = Img.Raster->GetRowRaster(y);
    for(x=0; x<Img.Raster->Size1D; x++)
    {
      if(x>90 && y>90 && x<200 && y<200)
        r1D->Set(x,&Color1);
      else
        r1D->Set(x,&Color2);
    }
  }

 return SavePicture("test2.bmp",Img);
}